	<!-- start about us -->
		<?php
		//初始化模板参数:$this->aboutusTitle、$this->aboutusTitleImg
		$this->aboutusTitle = 
		'近期活动旨在更为直观的汇总近期学校内将要举办的各类讲座比赛，
		消息来源于教务处、校团委以及青春广场上的各类通知';
		$this->aboutusTitleImg = $this->baseUrl().'/images/recentactTitleImg.jpg';
		
		$aboutusLayout = new Zend_Layout();
		echo $aboutusLayout->render('/module/aboutus');
		?>
	<!-- end about us -->
	
	<!-- start logos -->
	<div class="logos">
		
	</div>
	<!-- end logos -->
	
	<!-- start content -->
	<div id="vg-content" >

		<!-- start portfolio details -->
		<div id="portfolio-details" class="vg-page" >
		
			<!-- start details -->
			<?php
				//左侧信息
				//左侧登录
				$loginLayout = new Zend_Layout();
				echo $loginLayout->render('/module/login');  
			?>
			<article class="border-top c-four" style="border:1px solid">
				<div class="vg-item-article vg-portfolio-details" syle="border:1px solid;">
					<!-- title -->
					<!-- end title -->
					<!-- upload start -->
					<!-- upload ends -->
					<!-- download list start -->

					<div class="content">
						<div class="title">
						<h2>答疑系统</h2>
						</div>
						<div class="answersystemblock">
							<form action="<?php echo $this->baseUrl().'/answersystem/teacherdetail?week='.$this->week;?>" method="post">
							<div class="query">
							课程名称：<input type="text" id="class" name="class"/>
							答疑最少人数<input type="text" id="threshold" name="threshold"/>
							<button type="submit">提交登记</button>
							<p><?php if(isset($this->tipclass))echo $this->tipclass;?></p><p><?php if(isset($this->tipthreshold))echo $this->tipthreshold;?></p></br>
							请在下表中选择您将要答疑的时间<a href="<?php echo $this->baseUrl().'/answersystem/teacherdetail?week='.($this->week+1);?>"><button>下一周</button></a><a href="<?php echo $this->baseUrl().'/answersystem/teacherdetail?week='.($this->week-1);?>"><button>上一周</button></a>
							</div>
							
							<div class="weekdays">
							<?php 
								date_default_timezone_set('Asia/Shanghai');
								$weekdayarray = array('周日','周一','周二','周三','周四','周五','周六');
								for($i = 0;$i<7;$i++)
								    echo '<h4>'.$weekdayarray[$i].'<p>'.gmdate('Y/m/d',strtotime($this->daybegin.'-0:0') + $i*24*3600).'</p></h4>'; 
							?>
							
							</div>
							<div class="classtime">
							<h4>第一大节</h4><h4>第二大节</h4><h4>第三大节</h4><h4>第四大节</h4><h4>第五大节</h4>
							</div>
							<div class="table">
								<!-- 
								<div class="grid1"><p align="center" id="p1">计算机学院</p><p align="center" id="p2">冯伟森(25)</p><p align="center" id="p3">离散数学</p><a href="#">[取消]</a><a href="#">[决定]</a></div><div class="grid"></div><div class="grid"></div><div class="grid"></div><div class="grid"></div><div class="grid"></div><div class="grid"></div>
								<div class="grid"><p>登记<input type="checkbox"/></p></div><div class="grid"></div><div class="grid"></div><div class="grid"></div><div class="grid"></div><div class="grid"></div><div class="grid"></div>
								<div class="grid"></div><div class="grid"></div><div class="grid"></div><div class="grid"></div><div class="grid"></div><div class="grid"></div><div class="grid"></div>
								<div class="grid"></div><div class="grid"></div><div class="grid"></div><div class="grid"></div><div class="grid"></div><div class="grid"></div><div class="grid"></div>
								<div class="grid"></div><div class="grid2"><p align="center" id="p1">计算机学院</p><p align="center" id="p2">冯伟森(25)</p><p align="center" id="p3">离散数学</p><a>[已定]</a><a href="#">[取消]</a></div><div class="grid1"><p align="center" id="p1">计算机学院</p><p align="center" id="p2">冯伟森(25)</p><p align="center" id="p3">离散数学</p><input type="checkbox"/></div><div class="grid"></div><div class="grid"></div><div class="grid"></div><div class="grid"></div>
								 -->
								
								 
								 <?php
								 	//for($i = )
								 	    //$date = new Zend_Date('2012/8/11');
								 	    //echo $date;
								 	    //$hehe = new Zend_Date($date->get());
								 	    //echo $hehe; 
								 	    //$date->addWeek(1);
								 	    
								 	    //echo $date->getWeekday()
								 	    //print_r(Zend_Locale::getLocaleList());
								 	    //echo $date->get(Zend_Date::WEEKDAY);
								 	    $classtime = $this->classtime;
								 	    date_default_timezone_set('Asia/Shanghai');
								 	    $daybegin = $this->daybegin;
								 	    for($class=0;$class<5;$class++)//注意是从周日开始的
								 	    { 
								 	        for($weekday=0;$weekday<7;$weekday++)
								 	        {
								 	            $time = $daybegin.'-'.$classtime[$class];
								 	            $timecmp = strtotime($time)+$weekday*24*3600;
								 	            if($timecmp<=time()+8*3600)
								 	            {
								 	                echo '<div class="grid">';
								 	                echo '<p>这已成为历史</p></div>';
								 	                //echo /*gmdate('Y-m-d H:i:s',*/$timecmp.'</br>'.gmdate('Y-m-d H:i:s',time()+8*3600).'</div>';
								 	                
								 	            }
								 	            else 
								 	            {
								 	                $find = false;
								 	                if(isset($this->allapp))
								 	                {
								 	                    foreach($this->allapp as $key => $app)			 	         
								 	                	{
								 	                    	if($app['date']==$timecmp)
								 	                    	{
								 	                    	    $findindex = $key;
								 	                    	    $find = true;
								 	                    	    break;
								 	                    	}
								 	                	}
								 	                }
								 	                if(!$find)echo '<div class="grid"><p>登记<input type="checkbox" id="'.($class*7+$weekday).'" name="'.($class*7+$weekday).'"/></p></div>';
								 	                else 
								 	                {
														if($this->allapp[$findindex]['status']==2)
														{
														    echo '<div class="grid1" title="已有'.$this->allapp[$findindex]['countstudent'].'位同学登记"><p align="center" id="p1">'.$this->collegearray[$this->allapp[$findindex]['college']].'</p><p align="center" id="p2">'.$this->allapp[$findindex]['teacher'].'('.$this->allapp[$findindex]['countstudent'].')</p><p align="center" id="p3">'.$this->allapp[$findindex]['class'].'</p><a href="'.$this->baseUrl().'/answersystem/teachercancel?week='.$this->week.'&&id='.$this->allapp[$findindex]['id'].'">[取消]</a><a href="'.$this->baseUrl().'/answersystem/teachersure?week='.$this->week.'&&id='.$this->allapp[$findindex]['id'].'">[决定]</a></div>';
														     			 	                    
														}
														else if($this->allapp[$findindex]['status']==3)
														{
														    echo '<div class="grid2"><p align="center" id="p1">'.$this->collegearray[$this->allapp[$findindex]['college']].'</p><p align="center" id="p2">'.$this->allapp[$findindex]['teacher'].'</p><p align="center" id="p3">'.$this->allapp[$findindex]['class'].'</p><a>[已定]</a><a href="'.$this->baseUrl().'/answersystem/teachercancel?week='.$this->week.'&&id='.$this->allapp[$findindex]['id'].'">[取消]</a></div>';
														}
														else echo '<div class="grid"><p>登记<input type="checkbox" id="'.($class*7+$weekday).'" name="'.($class*7+$weekday).'"/></p></div>';
								 	                }
								 	            }
								 	            //echo $timecmp.'</br>';
														 	        
								 	        }
								 	        
								 	    }
								 ?>
								 </form>
							</div>
						</div>
					</div>	
				
				
				
				
				
					<!-- download list end -->
					<!-- pager start -->
					
					<!-- pager end -->
			  </div>
				
			</article>
			<!-- end details -->
			
	  </div>
	  <!-- end portfolio details -->
		
	</div>
	<!-- end content -->

<script type="text/javascript">

  var _gaq = _gaq || [];
  _gaq.push(['_setAccount', 'UA-23864149-2']);
  _gaq.push(['_trackPageview']);

  (function() {
    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
  })();
  function searchEnter(){
	if(event.keyCode==13){
		document.getElementById('searchform').submit();
		return false;
	}  
  }
</script>






